#ifndef _DV_API_H_
#define _DV_API_H_


typedef enum _INPORT{
	CVBS_Y0=0,
	CVBS_Y1=1,
	CVBS_Y2=2,
	CVBS_Y3=3,
	YC_Y1C=4,
	DTV1_RGB=5,  //DTVCLK
	DTV2_BT656=6,  //656_CLK
	ARGB_HV=7,   //Analog RGB+HV
	ARGB_SOG=8,  //Analog RGB+SOG
	EX_CVBS_Y0=9,
	EX_YC_Y1=10,
	MAXINPORT=11
}INPORT;

typedef enum _SIGFMT{
	NTSC,
	PAL,
	YUV480I,
	YUV576I,
	YUV480P,
	YUV576P,
	SVGA60,
	DTV2480I,
	DTV2576I,
	MAX_SIG_FMT,
	NOTDET
}SIGFMT;

typedef enum _OUTPORT{
	MAINWIN=0,
	PIP0WIN=1,
	PIP1WIN=2,
	MAXOUTPORT=3
}OUTPORT;

typedef enum _DISPMODE{
	//Main
	FULL_800x480,
	HALF_400x480,
	//PIP0
	SMALL_400x240,
	MIDDLE_600x400,
	LARGE_800x480,
	POP_400x480,
	DUAL0_400x240,
	//PIP1
	DUAL1_400x240,
	MAX_DISP_MODE
}DISPMODE;


void TW8823ModeInit(void);
void TW8823InPortSet(INPORT inport);
void TW8823OutPortSet(OUTPORT outport);
void TW8823SigFmtSet(SIGFMT sigfmt);
SIGFMT TW8823SigFmtDetect(INPORT inport);
void TW8823ModeSet(SIGFMT sigfmt, DISPMODE dispmode);
void TW8823OutPosSet(OUTPORT outport, WORD x, WORD y);
void TW8823OutPortMute(OUTPORT outport, BOOL onoff); //TRUE: Mute(Blue) FALSE: Show Video
BOOL TW8823OutPortMuteDetect(OUTPORT outport);
void TW8823OutPortEn(OUTPORT outport, BOOL onoff); //TRUE: Enable FALSE: Disable



#endif



